<%-- 
    Document   : ConfigurarPerfil
    Created on : 21-abr-2014, 17:15:26
    Author     : Isaac Paliza <anndysaac@hotmail.com>
--%>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="Modelo.ENT_Perfil"%>
<%@page import="Modelo.ENT_Feria"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        
    </head>
    <body>
        <%
            List<ENT_Feria> EF = (ArrayList<ENT_Feria>) request.getAttribute("CargarFeria");
        %>
        <%
            List<ENT_Perfil> EP = (ArrayList<ENT_Perfil>) request.getAttribute("CargarPerfil");
        %>
        <header>
            <samp style=color:#FA6900;>Configuracion de Perfiles</samp>
        </header>
        <section>
            <section>
                <br>
                <table width="100%" height="100%">
                    <tr>
                        <td>Codigo de Usuario</td>
                    <form action='ConfigurarPerfil' method="GET">
                        <td>
                            <input type="text" name="Usuario">
                        </td>
                        <td align="left">
                            ${requestScope['Mensaje']}
                        </td>
                        <td>
                            <input type="submit" name="BuscarUsuario">
                        </td>
                    </form>
                    </tr>
                </table>
            </section>
            <table width="100%" height="100%">
                <tr bgcolor= "#FBB829" border="1px" style="font-size: 12px;">
                    <td align="center">N</td>
                    <td align="center">ID Usuario</td>
                    <td>Nombre Perfil</td>
                    <td>Nombre Feria</td>
                    <td>Nombre Usuario</td>
                    <td align="center">Estado</td>
                    <td align="center">Ediptar</td>
                </tr>
                <br>
                <c:forEach items="${requestScope['CargarDatoBusqueda']}" var="d" varStatus="c">
                    <c:choose>
                        <c:when test="${(c.count % 2) == 0}"></c:when>
                        <c:otherwise><tr style="margin:0;" cellpadding="0" rules="groups" border="1"></c:otherwise>
                        </c:choose>
                    <form action="ConfigurarPerfil" method="GET" style="display:inline">
                        <td align="center" >${c.count}</td>
                        <td align="center">${d['idUsuario']}</td>
                        <td>${d['idPerfil']}</td>
                        <td>${d['idFeria']}</td>
                        <td>${d['nombre']}</td>
                        <td align="center" >${d['estado']}</td>
                        <td align="center" >
                            <input type="submit" name="EdiptarConfiguracion" value="Ediptar"/>
                        </td>
                    </form>
                    </tr>
                </c:forEach>
            </table>
            <br>
            <table rules="rows" border="1px" width="100%" height="100%">
                <form action="ConfigurarPerfil" method="GET" style="display:inline">
                <c:forEach items="${requestScope['CargarDatoUsuario']}" var="d" varStatus="c">
                <tr bgcolor= "#FBB829">
                    <td>Datos del Usuario</td>
                    <td colspan="3">Cambiar </td>
                </tr>
                <tr>
                    <td style=color:#0B2E59;>ID Usuario</td>
                    <td colspan="3">
                        <input type="hidden" name="idUsuario" value="${d['idUsuario']}"/>${d['idUsuario']}
                    </td>
                </tr>
                <tr>
                    <td style=color:#0B2E59;>Nombre Usuario</td>
                    <td colspan="3">${d['nombre']}</td>
                </tr>
                <tr>
                    <td style=color:#0B2E59;>Nombre Perfil</td>
                    <td>${d['idPerfil']}</td>
                    <td>
                        <select name="idPerfil" >
                            <option value="0" selected>Seleccionar...</option>
                            <% for (ENT_Perfil du : EP) {%>
                            <option value="<%= du.getIdPerfil()%>"><%= du.getNombre()%></option>
                            <% }%>
                        </select>
                    </td>
                    <td align="center">
                        <input type="submit" name="ActPerfil" value="OK"/>
                    </td>
                </tr>
                <tr>
                    <td style=color:#0B2E59;>Nombre Feria</td>
                    <td>${d['idFeria']}</td>
                    <td>
                        <select name="idFeria" >
                            <option value="0" selected>Seleccionar...</option>
                            <% for (ENT_Feria du : EF) {%>
                            <option value="<%= du.getIdFeria()%>"><%= du.getNombre()%></option>
                            <% }%>
                        </select>
                    </td>
                    <td align="center">
                        <input type="submit" name="ActFeria" value="OK"/>
                    </td>
                </tr>
                <tr>
                    <td style=color:#0B2E59;>Estado</td>
                    <td>${d['estado']}</td>
                    <td>
                        <select name="idEstado" onchange="opcionSelect(this.form)">
                            <option value="0" selected>Seleccionar...</option>
                            <option value="1">Activo</option>
                            <option value="2">Inactivo</option>
                        </select>
                    </td>
                    <td align="center">
                        <input type="submit" name="ActEstado" value="OK"/>
                    </td>
                </tr>
                <tr>
                    <td colspan="4" style=color:#FA6900; >${requestScope['MensajeAct']}</td>
                </tr>
                </c:forEach>
                </form>
            </table>
        </section>
    </body>
</html>
